.class public Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;
.super Lorg/jboss/netty/channel/SimpleChannelUpstreamHandler;
.source "SpdySessionHandler.java"

# interfaces
.implements Lorg/jboss/netty/channel/ChannelDownstreamHandler;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler$1;,
        Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler$ClosingChannelFutureListener;
    }
.end annotation


# static fields
.field private static final PROTOCOL_EXCEPTION:Lorg/jboss/netty/handler/codec/spdy/SpdyProtocolException;


# instance fields
.field private volatile closeSessionFuture:Lorg/jboss/netty/channel/ChannelFuture;

.field private volatile lastGoodStreamID:I

.field private volatile localConcurrentStreams:I

.field private volatile maxConcurrentStreams:I

.field private final pings:Ljava/util/concurrent/atomic/AtomicInteger;

.field private volatile receivedGoAwayFrame:Z

.field private volatile remoteConcurrentStreams:I

.field private volatile sentGoAwayFrame:Z

.field private final server:Z

.field private final spdySession:Lorg/jboss/netty/handler/codec/spdy/SpdySession;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 39
    new-instance v0, Lorg/jboss/netty/handler/codec/spdy/SpdyProtocolException;

    invoke-direct {v0}, Lorg/jboss/netty/handler/codec/spdy/SpdyProtocolException;-><init>()V

    sput-object v0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->PROTOCOL_EXCEPTION:Lorg/jboss/netty/handler/codec/spdy/SpdyProtocolException;

    return-void
.end method

.method public constructor <init>(Z)V
    .locals 1
    .parameter "server"

    .prologue
    .line 66
    invoke-direct {p0}, Lorg/jboss/netty/channel/SimpleChannelUpstreamHandler;-><init>()V

    .line 41
    new-instance v0, Lorg/jboss/netty/handler/codec/spdy/SpdySession;

    invoke-direct {v0}, Lorg/jboss/netty/handler/codec/spdy/SpdySession;-><init>()V

    iput-object v0, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->spdySession:Lorg/jboss/netty/handler/codec/spdy/SpdySession;

    .line 48
    new-instance v0, Ljava/util/concurrent/atomic/AtomicInteger;

    invoke-direct {v0}, Ljava/util/concurrent/atomic/AtomicInteger;-><init>()V

    iput-object v0, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->pings:Ljava/util/concurrent/atomic/AtomicInteger;

    .line 67
    iput-boolean p1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->server:Z

    .line 68
    return-void
.end method

.method private declared-synchronized acceptStream(IZZ)Z
    .locals 3
    .parameter "streamID"
    .parameter "remoteSideClosed"
    .parameter "localSideClosed"

    .prologue
    const/4 v0, 0x0

    .line 420
    monitor-enter p0

    :try_start_0
    iget-boolean v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->receivedGoAwayFrame:Z

    if-nez v1, :cond_0

    iget-boolean v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->sentGoAwayFrame:Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    if-eqz v1, :cond_1

    .line 431
    :cond_0
    :goto_0
    monitor-exit p0

    return v0

    .line 423
    :cond_1
    :try_start_1
    iget v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->maxConcurrentStreams:I

    if-eqz v1, :cond_2

    iget-object v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->spdySession:Lorg/jboss/netty/handler/codec/spdy/SpdySession;

    invoke-virtual {v1}, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->numActiveStreams()I

    move-result v1

    iget v2, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->maxConcurrentStreams:I

    if-ge v1, v2, :cond_0

    .line 427
    :cond_2
    iget-object v0, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->spdySession:Lorg/jboss/netty/handler/codec/spdy/SpdySession;

    invoke-virtual {v0, p1, p2, p3}, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->acceptStream(IZZ)V

    .line 428
    invoke-direct {p0, p1}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->isRemoteInitiatedID(I)Z

    move-result v0

    if-eqz v0, :cond_3

    .line 429
    iput p1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->lastGoodStreamID:I
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 431
    :cond_3
    const/4 v0, 0x1

    goto :goto_0

    .line 420
    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method private halfCloseStream(IZ)V
    .locals 1
    .parameter "streamID"
    .parameter "remote"

    .prologue
    .line 435
    if-eqz p2, :cond_1

    .line 436
    iget-object v0, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->spdySession:Lorg/jboss/netty/handler/codec/spdy/SpdySession;

    invoke-virtual {v0, p1}, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->closeRemoteSide(I)V

    .line 440
    :goto_0
    iget-object v0, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->closeSessionFuture:Lorg/jboss/netty/channel/ChannelFuture;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->spdySession:Lorg/jboss/netty/handler/codec/spdy/SpdySession;

    invoke-virtual {v0}, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->noActiveStreams()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 441
    iget-object v0, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->closeSessionFuture:Lorg/jboss/netty/channel/ChannelFuture;

    invoke-interface {v0}, Lorg/jboss/netty/channel/ChannelFuture;->setSuccess()Z

    .line 443
    :cond_0
    return-void

    .line 438
    :cond_1
    iget-object v0, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->spdySession:Lorg/jboss/netty/handler/codec/spdy/SpdySession;

    invoke-virtual {v0, p1}, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->closeLocalSide(I)V

    goto :goto_0
.end method

.method private isRemoteInitiatedID(I)Z
    .locals 2
    .parameter "ID"

    .prologue
    .line 386
    invoke-direct {p0, p1}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->isServerID(I)Z

    move-result v0

    .line 387
    .local v0, serverID:Z
    iget-boolean v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->server:Z

    if-eqz v1, :cond_0

    if-eqz v0, :cond_1

    :cond_0
    iget-boolean v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->server:Z

    if-nez v1, :cond_2

    if-eqz v0, :cond_2

    :cond_1
    const/4 v1, 0x1

    :goto_0
    return v1

    :cond_2
    const/4 v1, 0x0

    goto :goto_0
.end method

.method private isServerID(I)Z
    .locals 1
    .parameter "ID"

    .prologue
    .line 382
    rem-int/lit8 v0, p1, 0x2

    if-nez v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method private issueSessionError(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/Channel;Ljava/net/SocketAddress;)V
    .locals 2
    .parameter "ctx"
    .parameter "channel"
    .parameter "remoteAddress"

    .prologue
    .line 363
    invoke-direct {p0, p1, p2, p3}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->sendGoAwayFrame(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/Channel;Ljava/net/SocketAddress;)Lorg/jboss/netty/channel/ChannelFuture;

    move-result-object v0

    .line 364
    .local v0, future:Lorg/jboss/netty/channel/ChannelFuture;
    sget-object v1, Lorg/jboss/netty/channel/ChannelFutureListener;->CLOSE:Lorg/jboss/netty/channel/ChannelFutureListener;

    invoke-interface {v0, v1}, Lorg/jboss/netty/channel/ChannelFuture;->addListener(Lorg/jboss/netty/channel/ChannelFutureListener;)V

    .line 365
    return-void
.end method

.method private issueStreamError(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/MessageEvent;ILorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;)V
    .locals 3
    .parameter "ctx"
    .parameter "e"
    .parameter "streamID"
    .parameter "status"

    .prologue
    .line 372
    invoke-direct {p0, p3}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->removeStream(I)V

    .line 373
    new-instance v0, Lorg/jboss/netty/handler/codec/spdy/DefaultSpdyRstStreamFrame;

    invoke-direct {v0, p3, p4}, Lorg/jboss/netty/handler/codec/spdy/DefaultSpdyRstStreamFrame;-><init>(ILorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;)V

    .line 374
    .local v0, spdyRstStreamFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyRstStreamFrame;
    invoke-interface {p2}, Lorg/jboss/netty/channel/MessageEvent;->getChannel()Lorg/jboss/netty/channel/Channel;

    move-result-object v1

    invoke-static {v1}, Lorg/jboss/netty/channel/Channels;->future(Lorg/jboss/netty/channel/Channel;)Lorg/jboss/netty/channel/ChannelFuture;

    move-result-object v1

    invoke-interface {p2}, Lorg/jboss/netty/channel/MessageEvent;->getRemoteAddress()Ljava/net/SocketAddress;

    move-result-object v2

    invoke-static {p1, v1, v0, v2}, Lorg/jboss/netty/channel/Channels;->write(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/ChannelFuture;Ljava/lang/Object;Ljava/net/SocketAddress;)V

    .line 375
    return-void
.end method

.method private removeStream(I)V
    .locals 1
    .parameter "streamID"

    .prologue
    .line 446
    iget-object v0, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->spdySession:Lorg/jboss/netty/handler/codec/spdy/SpdySession;

    invoke-virtual {v0, p1}, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->removeStream(I)V

    .line 447
    iget-object v0, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->closeSessionFuture:Lorg/jboss/netty/channel/ChannelFuture;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->spdySession:Lorg/jboss/netty/handler/codec/spdy/SpdySession;

    invoke-virtual {v0}, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->noActiveStreams()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 448
    iget-object v0, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->closeSessionFuture:Lorg/jboss/netty/channel/ChannelFuture;

    invoke-interface {v0}, Lorg/jboss/netty/channel/ChannelFuture;->setSuccess()Z

    .line 450
    :cond_0
    return-void
.end method

.method private declared-synchronized sendGoAwayFrame(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/Channel;Ljava/net/SocketAddress;)Lorg/jboss/netty/channel/ChannelFuture;
    .locals 3
    .parameter "ctx"
    .parameter "channel"
    .parameter "remoteAddress"

    .prologue
    .line 470
    monitor-enter p0

    :try_start_0
    iget-boolean v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->sentGoAwayFrame:Z

    if-nez v1, :cond_0

    .line 471
    const/4 v1, 0x1

    iput-boolean v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->sentGoAwayFrame:Z

    .line 472
    invoke-static {p2}, Lorg/jboss/netty/channel/Channels;->future(Lorg/jboss/netty/channel/Channel;)Lorg/jboss/netty/channel/ChannelFuture;

    move-result-object v0

    .line 473
    .local v0, future:Lorg/jboss/netty/channel/ChannelFuture;
    new-instance v1, Lorg/jboss/netty/handler/codec/spdy/DefaultSpdyGoAwayFrame;

    iget v2, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->lastGoodStreamID:I

    invoke-direct {v1, v2}, Lorg/jboss/netty/handler/codec/spdy/DefaultSpdyGoAwayFrame;-><init>(I)V

    invoke-static {p1, v0, v1}, Lorg/jboss/netty/channel/Channels;->write(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/ChannelFuture;Ljava/lang/Object;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 476
    .end local v0           #future:Lorg/jboss/netty/channel/ChannelFuture;
    :goto_0
    monitor-exit p0

    return-object v0

    :cond_0
    :try_start_1
    invoke-static {p2}, Lorg/jboss/netty/channel/Channels;->succeededFuture(Lorg/jboss/netty/channel/Channel;)Lorg/jboss/netty/channel/ChannelFuture;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    move-result-object v0

    goto :goto_0

    .line 470
    :catchall_0
    move-exception v1

    monitor-exit p0

    throw v1
.end method

.method private sendGoAwayFrame(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/ChannelStateEvent;)V
    .locals 3
    .parameter "ctx"
    .parameter "e"

    .prologue
    .line 454
    invoke-interface {p2}, Lorg/jboss/netty/channel/ChannelStateEvent;->getChannel()Lorg/jboss/netty/channel/Channel;

    move-result-object v1

    invoke-interface {v1}, Lorg/jboss/netty/channel/Channel;->isConnected()Z

    move-result v1

    if-nez v1, :cond_0

    .line 455
    invoke-interface {p1, p2}, Lorg/jboss/netty/channel/ChannelHandlerContext;->sendDownstream(Lorg/jboss/netty/channel/ChannelEvent;)V

    .line 466
    :goto_0
    return-void

    .line 459
    :cond_0
    invoke-interface {p2}, Lorg/jboss/netty/channel/ChannelStateEvent;->getChannel()Lorg/jboss/netty/channel/Channel;

    move-result-object v1

    const/4 v2, 0x0

    invoke-direct {p0, p1, v1, v2}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->sendGoAwayFrame(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/Channel;Ljava/net/SocketAddress;)Lorg/jboss/netty/channel/ChannelFuture;

    move-result-object v0

    .line 460
    .local v0, future:Lorg/jboss/netty/channel/ChannelFuture;
    iget-object v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->spdySession:Lorg/jboss/netty/handler/codec/spdy/SpdySession;

    invoke-virtual {v1}, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->noActiveStreams()Z

    move-result v1

    if-eqz v1, :cond_1

    .line 461
    new-instance v1, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler$ClosingChannelFutureListener;

    invoke-direct {v1, p1, p2}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler$ClosingChannelFutureListener;-><init>(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/ChannelStateEvent;)V

    invoke-interface {v0, v1}, Lorg/jboss/netty/channel/ChannelFuture;->addListener(Lorg/jboss/netty/channel/ChannelFutureListener;)V

    goto :goto_0

    .line 463
    :cond_1
    invoke-interface {p2}, Lorg/jboss/netty/channel/ChannelStateEvent;->getChannel()Lorg/jboss/netty/channel/Channel;

    move-result-object v1

    invoke-static {v1}, Lorg/jboss/netty/channel/Channels;->future(Lorg/jboss/netty/channel/Channel;)Lorg/jboss/netty/channel/ChannelFuture;

    move-result-object v1

    iput-object v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->closeSessionFuture:Lorg/jboss/netty/channel/ChannelFuture;

    .line 464
    iget-object v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->closeSessionFuture:Lorg/jboss/netty/channel/ChannelFuture;

    new-instance v2, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler$ClosingChannelFutureListener;

    invoke-direct {v2, p1, p2}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler$ClosingChannelFutureListener;-><init>(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/ChannelStateEvent;)V

    invoke-interface {v1, v2}, Lorg/jboss/netty/channel/ChannelFuture;->addListener(Lorg/jboss/netty/channel/ChannelFutureListener;)V

    goto :goto_0
.end method

.method private declared-synchronized updateConcurrentStreams(Lorg/jboss/netty/handler/codec/spdy/SpdySettingsFrame;Z)V
    .locals 3
    .parameter "settings"
    .parameter "remote"

    .prologue
    .line 391
    monitor-enter p0

    const/4 v1, 0x4

    :try_start_0
    invoke-interface {p1, v1}, Lorg/jboss/netty/handler/codec/spdy/SpdySettingsFrame;->getValue(I)I

    move-result v0

    .line 392
    .local v0, newConcurrentStreams:I
    if-eqz p2, :cond_0

    .line 393
    iput v0, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->remoteConcurrentStreams:I

    .line 397
    :goto_0
    iget v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->localConcurrentStreams:I

    iget v2, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->remoteConcurrentStreams:I

    if-ne v1, v2, :cond_1

    .line 398
    iget v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->localConcurrentStreams:I

    iput v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->maxConcurrentStreams:I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 414
    :goto_1
    monitor-exit p0

    return-void

    .line 395
    :cond_0
    :try_start_1
    iput v0, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->localConcurrentStreams:I
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    .line 391
    .end local v0           #newConcurrentStreams:I
    :catchall_0
    move-exception v1

    monitor-exit p0

    throw v1

    .line 401
    .restart local v0       #newConcurrentStreams:I
    :cond_1
    :try_start_2
    iget v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->localConcurrentStreams:I

    if-nez v1, :cond_2

    .line 402
    iget v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->remoteConcurrentStreams:I

    iput v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->maxConcurrentStreams:I

    goto :goto_1

    .line 405
    :cond_2
    iget v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->remoteConcurrentStreams:I

    if-nez v1, :cond_3

    .line 406
    iget v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->localConcurrentStreams:I

    iput v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->maxConcurrentStreams:I

    goto :goto_1

    .line 409
    :cond_3
    iget v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->localConcurrentStreams:I

    iget v2, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->remoteConcurrentStreams:I

    if-le v1, v2, :cond_4

    .line 410
    iget v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->remoteConcurrentStreams:I

    iput v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->maxConcurrentStreams:I

    goto :goto_1

    .line 412
    :cond_4
    iget v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->localConcurrentStreams:I

    iput v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->maxConcurrentStreams:I
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    goto :goto_1
.end method


# virtual methods
.method public handleDownstream(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/ChannelEvent;)V
    .locals 18
    .parameter "ctx"
    .parameter "evt"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    .prologue
    .line 258
    move-object/from16 v0, p2

    instance-of v14, v0, Lorg/jboss/netty/channel/ChannelStateEvent;

    if-eqz v14, :cond_0

    move-object/from16 v2, p2

    .line 259
    check-cast v2, Lorg/jboss/netty/channel/ChannelStateEvent;

    .line 260
    .local v2, e:Lorg/jboss/netty/channel/ChannelStateEvent;
    sget-object v14, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler$1;->$SwitchMap$org$jboss$netty$channel$ChannelState:[I

    invoke-interface {v2}, Lorg/jboss/netty/channel/ChannelStateEvent;->getState()Lorg/jboss/netty/channel/ChannelState;

    move-result-object v15

    invoke-virtual {v15}, Lorg/jboss/netty/channel/ChannelState;->ordinal()I

    move-result v15

    aget v14, v14, v15

    packed-switch v14, :pswitch_data_0

    .line 270
    .end local v2           #e:Lorg/jboss/netty/channel/ChannelStateEvent;
    :cond_0
    move-object/from16 v0, p2

    instance-of v14, v0, Lorg/jboss/netty/channel/MessageEvent;

    if-nez v14, :cond_2

    .line 271
    invoke-interface/range {p1 .. p2}, Lorg/jboss/netty/channel/ChannelHandlerContext;->sendDownstream(Lorg/jboss/netty/channel/ChannelEvent;)V

    .line 354
    :goto_0
    return-void

    .line 264
    .restart local v2       #e:Lorg/jboss/netty/channel/ChannelStateEvent;
    :pswitch_0
    sget-object v14, Ljava/lang/Boolean;->FALSE:Ljava/lang/Boolean;

    invoke-interface {v2}, Lorg/jboss/netty/channel/ChannelStateEvent;->getValue()Ljava/lang/Object;

    move-result-object v15

    invoke-virtual {v14, v15}, Ljava/lang/Boolean;->equals(Ljava/lang/Object;)Z

    move-result v14

    if-nez v14, :cond_1

    invoke-interface {v2}, Lorg/jboss/netty/channel/ChannelStateEvent;->getValue()Ljava/lang/Object;

    move-result-object v14

    if-nez v14, :cond_0

    .line 265
    :cond_1
    move-object/from16 v0, p0

    move-object/from16 v1, p1

    invoke-direct {v0, v1, v2}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->sendGoAwayFrame(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/ChannelStateEvent;)V

    goto :goto_0

    .end local v2           #e:Lorg/jboss/netty/channel/ChannelStateEvent;
    :cond_2
    move-object/from16 v2, p2

    .line 275
    check-cast v2, Lorg/jboss/netty/channel/MessageEvent;

    .line 276
    .local v2, e:Lorg/jboss/netty/channel/MessageEvent;
    invoke-interface {v2}, Lorg/jboss/netty/channel/MessageEvent;->getMessage()Ljava/lang/Object;

    move-result-object v4

    .line 278
    .local v4, msg:Ljava/lang/Object;
    instance-of v14, v4, Lorg/jboss/netty/handler/codec/spdy/SpdyDataFrame;

    if-eqz v14, :cond_5

    move-object v6, v4

    .line 280
    check-cast v6, Lorg/jboss/netty/handler/codec/spdy/SpdyDataFrame;

    .line 281
    .local v6, spdyDataFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyDataFrame;
    invoke-interface {v6}, Lorg/jboss/netty/handler/codec/spdy/SpdyDataFrame;->getStreamID()I

    move-result v13

    .line 283
    .local v13, streamID:I
    move-object/from16 v0, p0

    iget-object v14, v0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->spdySession:Lorg/jboss/netty/handler/codec/spdy/SpdySession;

    invoke-virtual {v14, v13}, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->isLocalSideClosed(I)Z

    move-result v14

    if-eqz v14, :cond_3

    .line 284
    invoke-interface {v2}, Lorg/jboss/netty/channel/MessageEvent;->getFuture()Lorg/jboss/netty/channel/ChannelFuture;

    move-result-object v14

    sget-object v15, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->PROTOCOL_EXCEPTION:Lorg/jboss/netty/handler/codec/spdy/SpdyProtocolException;

    invoke-interface {v14, v15}, Lorg/jboss/netty/channel/ChannelFuture;->setFailure(Ljava/lang/Throwable;)Z

    goto :goto_0

    .line 288
    :cond_3
    invoke-interface {v6}, Lorg/jboss/netty/handler/codec/spdy/SpdyDataFrame;->isLast()Z

    move-result v14

    if-eqz v14, :cond_4

    .line 289
    const/4 v14, 0x0

    move-object/from16 v0, p0

    invoke-direct {v0, v13, v14}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->halfCloseStream(IZ)V

    .line 353
    .end local v6           #spdyDataFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyDataFrame;
    .end local v13           #streamID:I
    :cond_4
    :goto_1
    invoke-interface/range {p1 .. p2}, Lorg/jboss/netty/channel/ChannelHandlerContext;->sendDownstream(Lorg/jboss/netty/channel/ChannelEvent;)V

    goto :goto_0

    .line 292
    :cond_5
    instance-of v14, v4, Lorg/jboss/netty/handler/codec/spdy/SpdySynStreamFrame;

    if-eqz v14, :cond_6

    move-object v12, v4

    .line 294
    check-cast v12, Lorg/jboss/netty/handler/codec/spdy/SpdySynStreamFrame;

    .line 295
    .local v12, spdySynStreamFrame:Lorg/jboss/netty/handler/codec/spdy/SpdySynStreamFrame;
    invoke-interface {v12}, Lorg/jboss/netty/handler/codec/spdy/SpdySynStreamFrame;->isUnidirectional()Z

    move-result v5

    .line 296
    .local v5, remoteSideClosed:Z
    invoke-interface {v12}, Lorg/jboss/netty/handler/codec/spdy/SpdySynStreamFrame;->isLast()Z

    move-result v3

    .line 297
    .local v3, localSideClosed:Z
    invoke-interface {v12}, Lorg/jboss/netty/handler/codec/spdy/SpdySynStreamFrame;->getStreamID()I

    move-result v14

    move-object/from16 v0, p0

    invoke-direct {v0, v14, v5, v3}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->acceptStream(IZZ)Z

    move-result v14

    if-nez v14, :cond_4

    .line 298
    invoke-interface {v2}, Lorg/jboss/netty/channel/MessageEvent;->getFuture()Lorg/jboss/netty/channel/ChannelFuture;

    move-result-object v14

    sget-object v15, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->PROTOCOL_EXCEPTION:Lorg/jboss/netty/handler/codec/spdy/SpdyProtocolException;

    invoke-interface {v14, v15}, Lorg/jboss/netty/channel/ChannelFuture;->setFailure(Ljava/lang/Throwable;)Z

    goto :goto_0

    .line 302
    .end local v3           #localSideClosed:Z
    .end local v5           #remoteSideClosed:Z
    .end local v12           #spdySynStreamFrame:Lorg/jboss/netty/handler/codec/spdy/SpdySynStreamFrame;
    :cond_6
    instance-of v14, v4, Lorg/jboss/netty/handler/codec/spdy/SpdySynReplyFrame;

    if-eqz v14, :cond_9

    move-object v11, v4

    .line 304
    check-cast v11, Lorg/jboss/netty/handler/codec/spdy/SpdySynReplyFrame;

    .line 305
    .local v11, spdySynReplyFrame:Lorg/jboss/netty/handler/codec/spdy/SpdySynReplyFrame;
    invoke-interface {v11}, Lorg/jboss/netty/handler/codec/spdy/SpdySynReplyFrame;->getStreamID()I

    move-result v13

    .line 307
    .restart local v13       #streamID:I
    move-object/from16 v0, p0

    invoke-direct {v0, v13}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->isRemoteInitiatedID(I)Z

    move-result v14

    if-eqz v14, :cond_7

    move-object/from16 v0, p0

    iget-object v14, v0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->spdySession:Lorg/jboss/netty/handler/codec/spdy/SpdySession;

    invoke-virtual {v14, v13}, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->isLocalSideClosed(I)Z

    move-result v14

    if-eqz v14, :cond_8

    .line 308
    :cond_7
    invoke-interface {v2}, Lorg/jboss/netty/channel/MessageEvent;->getFuture()Lorg/jboss/netty/channel/ChannelFuture;

    move-result-object v14

    sget-object v15, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->PROTOCOL_EXCEPTION:Lorg/jboss/netty/handler/codec/spdy/SpdyProtocolException;

    invoke-interface {v14, v15}, Lorg/jboss/netty/channel/ChannelFuture;->setFailure(Ljava/lang/Throwable;)Z

    goto/16 :goto_0

    .line 312
    :cond_8
    invoke-interface {v11}, Lorg/jboss/netty/handler/codec/spdy/SpdySynReplyFrame;->isLast()Z

    move-result v14

    if-eqz v14, :cond_4

    .line 313
    const/4 v14, 0x0

    move-object/from16 v0, p0

    invoke-direct {v0, v13, v14}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->halfCloseStream(IZ)V

    goto :goto_1

    .line 316
    .end local v11           #spdySynReplyFrame:Lorg/jboss/netty/handler/codec/spdy/SpdySynReplyFrame;
    .end local v13           #streamID:I
    :cond_9
    instance-of v14, v4, Lorg/jboss/netty/handler/codec/spdy/SpdyRstStreamFrame;

    if-eqz v14, :cond_a

    move-object v9, v4

    .line 318
    check-cast v9, Lorg/jboss/netty/handler/codec/spdy/SpdyRstStreamFrame;

    .line 319
    .local v9, spdyRstStreamFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyRstStreamFrame;
    invoke-interface {v9}, Lorg/jboss/netty/handler/codec/spdy/SpdyRstStreamFrame;->getStreamID()I

    move-result v14

    move-object/from16 v0, p0

    invoke-direct {v0, v14}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->removeStream(I)V

    goto :goto_1

    .line 321
    .end local v9           #spdyRstStreamFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyRstStreamFrame;
    :cond_a
    instance-of v14, v4, Lorg/jboss/netty/handler/codec/spdy/SpdySettingsFrame;

    if-eqz v14, :cond_b

    move-object v10, v4

    .line 323
    check-cast v10, Lorg/jboss/netty/handler/codec/spdy/SpdySettingsFrame;

    .line 324
    .local v10, spdySettingsFrame:Lorg/jboss/netty/handler/codec/spdy/SpdySettingsFrame;
    const/4 v14, 0x0

    move-object/from16 v0, p0

    invoke-direct {v0, v10, v14}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->updateConcurrentStreams(Lorg/jboss/netty/handler/codec/spdy/SpdySettingsFrame;Z)V

    goto :goto_1

    .line 326
    .end local v10           #spdySettingsFrame:Lorg/jboss/netty/handler/codec/spdy/SpdySettingsFrame;
    :cond_b
    instance-of v14, v4, Lorg/jboss/netty/handler/codec/spdy/SpdyPingFrame;

    if-eqz v14, :cond_d

    move-object v8, v4

    .line 328
    check-cast v8, Lorg/jboss/netty/handler/codec/spdy/SpdyPingFrame;

    .line 329
    .local v8, spdyPingFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyPingFrame;
    invoke-interface {v8}, Lorg/jboss/netty/handler/codec/spdy/SpdyPingFrame;->getID()I

    move-result v14

    move-object/from16 v0, p0

    invoke-direct {v0, v14}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->isRemoteInitiatedID(I)Z

    move-result v14

    if-eqz v14, :cond_c

    .line 330
    invoke-interface {v2}, Lorg/jboss/netty/channel/MessageEvent;->getFuture()Lorg/jboss/netty/channel/ChannelFuture;

    move-result-object v14

    new-instance v15, Ljava/lang/IllegalArgumentException;

    new-instance v16, Ljava/lang/StringBuilder;

    invoke-direct/range {v16 .. v16}, Ljava/lang/StringBuilder;-><init>()V

    const-string v17, "invalid PING ID: "

    invoke-virtual/range {v16 .. v17}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v16

    invoke-interface {v8}, Lorg/jboss/netty/handler/codec/spdy/SpdyPingFrame;->getID()I

    move-result v17

    invoke-virtual/range {v16 .. v17}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v16

    invoke-virtual/range {v16 .. v16}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v16

    invoke-direct/range {v15 .. v16}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    invoke-interface {v14, v15}, Lorg/jboss/netty/channel/ChannelFuture;->setFailure(Ljava/lang/Throwable;)Z

    goto/16 :goto_0

    .line 334
    :cond_c
    move-object/from16 v0, p0

    iget-object v14, v0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->pings:Ljava/util/concurrent/atomic/AtomicInteger;

    invoke-virtual {v14}, Ljava/util/concurrent/atomic/AtomicInteger;->getAndIncrement()I

    goto/16 :goto_1

    .line 336
    .end local v8           #spdyPingFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyPingFrame;
    :cond_d
    instance-of v14, v4, Lorg/jboss/netty/handler/codec/spdy/SpdyGoAwayFrame;

    if-eqz v14, :cond_e

    .line 339
    invoke-interface {v2}, Lorg/jboss/netty/channel/MessageEvent;->getFuture()Lorg/jboss/netty/channel/ChannelFuture;

    move-result-object v14

    sget-object v15, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->PROTOCOL_EXCEPTION:Lorg/jboss/netty/handler/codec/spdy/SpdyProtocolException;

    invoke-interface {v14, v15}, Lorg/jboss/netty/channel/ChannelFuture;->setFailure(Ljava/lang/Throwable;)Z

    goto/16 :goto_0

    .line 342
    :cond_e
    instance-of v14, v4, Lorg/jboss/netty/handler/codec/spdy/SpdyHeadersFrame;

    if-eqz v14, :cond_4

    move-object v7, v4

    .line 344
    check-cast v7, Lorg/jboss/netty/handler/codec/spdy/SpdyHeadersFrame;

    .line 345
    .local v7, spdyHeadersFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyHeadersFrame;
    invoke-interface {v7}, Lorg/jboss/netty/handler/codec/spdy/SpdyHeadersFrame;->getStreamID()I

    move-result v13

    .line 347
    .restart local v13       #streamID:I
    move-object/from16 v0, p0

    iget-object v14, v0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->spdySession:Lorg/jboss/netty/handler/codec/spdy/SpdySession;

    invoke-virtual {v14, v13}, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->isLocalSideClosed(I)Z

    move-result v14

    if-eqz v14, :cond_4

    .line 348
    invoke-interface {v2}, Lorg/jboss/netty/channel/MessageEvent;->getFuture()Lorg/jboss/netty/channel/ChannelFuture;

    move-result-object v14

    sget-object v15, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->PROTOCOL_EXCEPTION:Lorg/jboss/netty/handler/codec/spdy/SpdyProtocolException;

    invoke-interface {v14, v15}, Lorg/jboss/netty/channel/ChannelFuture;->setFailure(Ljava/lang/Throwable;)Z

    goto/16 :goto_0

    .line 260
    nop

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_0
        :pswitch_0
    .end packed-switch
.end method

.method public messageReceived(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/MessageEvent;)V
    .locals 13
    .parameter "ctx"
    .parameter "e"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    .prologue
    const/4 v12, 0x1

    .line 74
    invoke-interface {p2}, Lorg/jboss/netty/channel/MessageEvent;->getMessage()Ljava/lang/Object;

    move-result-object v1

    .line 75
    .local v1, msg:Ljava/lang/Object;
    instance-of v11, v1, Lorg/jboss/netty/handler/codec/spdy/SpdyDataFrame;

    if-eqz v11, :cond_4

    move-object v3, v1

    .line 96
    check-cast v3, Lorg/jboss/netty/handler/codec/spdy/SpdyDataFrame;

    .line 97
    .local v3, spdyDataFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyDataFrame;
    invoke-interface {v3}, Lorg/jboss/netty/handler/codec/spdy/SpdyDataFrame;->getStreamID()I

    move-result v10

    .line 100
    .local v10, streamID:I
    iget-object v11, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->spdySession:Lorg/jboss/netty/handler/codec/spdy/SpdySession;

    invoke-virtual {v11, v10}, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->isRemoteSideClosed(I)Z

    move-result v11

    if-eqz v11, :cond_1

    .line 101
    iget-boolean v11, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->sentGoAwayFrame:Z

    if-nez v11, :cond_0

    .line 102
    sget-object v11, Lorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;->INVALID_STREAM:Lorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;

    invoke-direct {p0, p1, p2, v10, v11}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->issueStreamError(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/MessageEvent;ILorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;)V

    .line 254
    .end local v3           #spdyDataFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyDataFrame;
    .end local v10           #streamID:I
    :cond_0
    :goto_0
    return-void

    .line 108
    .restart local v3       #spdyDataFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyDataFrame;
    .restart local v10       #streamID:I
    :cond_1
    invoke-direct {p0, v10}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->isRemoteInitiatedID(I)Z

    move-result v11

    if-nez v11, :cond_2

    iget-object v11, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->spdySession:Lorg/jboss/netty/handler/codec/spdy/SpdySession;

    invoke-virtual {v11, v10}, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->hasReceivedReply(I)Z

    move-result v11

    if-nez v11, :cond_2

    .line 109
    sget-object v11, Lorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;->PROTOCOL_ERROR:Lorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;

    invoke-direct {p0, p1, p2, v10, v11}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->issueStreamError(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/MessageEvent;ILorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;)V

    goto :goto_0

    .line 113
    :cond_2
    invoke-interface {v3}, Lorg/jboss/netty/handler/codec/spdy/SpdyDataFrame;->isLast()Z

    move-result v11

    if-eqz v11, :cond_3

    .line 115
    invoke-direct {p0, v10, v12}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->halfCloseStream(IZ)V

    .line 253
    .end local v3           #spdyDataFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyDataFrame;
    .end local v10           #streamID:I
    :cond_3
    :goto_1
    invoke-super {p0, p1, p2}, Lorg/jboss/netty/channel/SimpleChannelUpstreamHandler;->messageReceived(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/MessageEvent;)V

    goto :goto_0

    .line 118
    :cond_4
    instance-of v11, v1, Lorg/jboss/netty/handler/codec/spdy/SpdySynStreamFrame;

    if-eqz v11, :cond_8

    move-object v9, v1

    .line 130
    check-cast v9, Lorg/jboss/netty/handler/codec/spdy/SpdySynStreamFrame;

    .line 131
    .local v9, spdySynStreamFrame:Lorg/jboss/netty/handler/codec/spdy/SpdySynStreamFrame;
    invoke-interface {v9}, Lorg/jboss/netty/handler/codec/spdy/SpdySynStreamFrame;->getStreamID()I

    move-result v10

    .line 134
    .restart local v10       #streamID:I
    invoke-interface {v9}, Lorg/jboss/netty/handler/codec/spdy/SpdySynStreamFrame;->isInvalid()Z

    move-result v11

    if-nez v11, :cond_5

    invoke-direct {p0, v10}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->isRemoteInitiatedID(I)Z

    move-result v11

    if-eqz v11, :cond_5

    iget-object v11, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->spdySession:Lorg/jboss/netty/handler/codec/spdy/SpdySession;

    invoke-virtual {v11, v10}, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->isActiveStream(I)Z

    move-result v11

    if-eqz v11, :cond_6

    .line 137
    :cond_5
    sget-object v11, Lorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;->PROTOCOL_ERROR:Lorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;

    invoke-direct {p0, p1, p2, v10, v11}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->issueStreamError(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/MessageEvent;ILorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;)V

    goto :goto_0

    .line 142
    :cond_6
    iget v11, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->lastGoodStreamID:I

    if-ge v10, v11, :cond_7

    .line 143
    invoke-interface {p2}, Lorg/jboss/netty/channel/MessageEvent;->getChannel()Lorg/jboss/netty/channel/Channel;

    move-result-object v11

    invoke-interface {p2}, Lorg/jboss/netty/channel/MessageEvent;->getRemoteAddress()Ljava/net/SocketAddress;

    move-result-object v12

    invoke-direct {p0, p1, v11, v12}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->issueSessionError(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/Channel;Ljava/net/SocketAddress;)V

    goto :goto_0

    .line 148
    :cond_7
    invoke-interface {v9}, Lorg/jboss/netty/handler/codec/spdy/SpdySynStreamFrame;->isLast()Z

    move-result v2

    .line 149
    .local v2, remoteSideClosed:Z
    invoke-interface {v9}, Lorg/jboss/netty/handler/codec/spdy/SpdySynStreamFrame;->isUnidirectional()Z

    move-result v0

    .line 150
    .local v0, localSideClosed:Z
    invoke-direct {p0, v10, v2, v0}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->acceptStream(IZZ)Z

    move-result v11

    if-nez v11, :cond_3

    .line 151
    sget-object v11, Lorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;->REFUSED_STREAM:Lorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;

    invoke-direct {p0, p1, p2, v10, v11}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->issueStreamError(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/MessageEvent;ILorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;)V

    goto :goto_0

    .line 155
    .end local v0           #localSideClosed:Z
    .end local v2           #remoteSideClosed:Z
    .end local v9           #spdySynStreamFrame:Lorg/jboss/netty/handler/codec/spdy/SpdySynStreamFrame;
    .end local v10           #streamID:I
    :cond_8
    instance-of v11, v1, Lorg/jboss/netty/handler/codec/spdy/SpdySynReplyFrame;

    if-eqz v11, :cond_c

    move-object v8, v1

    .line 164
    check-cast v8, Lorg/jboss/netty/handler/codec/spdy/SpdySynReplyFrame;

    .line 165
    .local v8, spdySynReplyFrame:Lorg/jboss/netty/handler/codec/spdy/SpdySynReplyFrame;
    invoke-interface {v8}, Lorg/jboss/netty/handler/codec/spdy/SpdySynReplyFrame;->getStreamID()I

    move-result v10

    .line 168
    .restart local v10       #streamID:I
    invoke-interface {v8}, Lorg/jboss/netty/handler/codec/spdy/SpdySynReplyFrame;->isInvalid()Z

    move-result v11

    if-nez v11, :cond_9

    invoke-direct {p0, v10}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->isRemoteInitiatedID(I)Z

    move-result v11

    if-nez v11, :cond_9

    iget-object v11, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->spdySession:Lorg/jboss/netty/handler/codec/spdy/SpdySession;

    invoke-virtual {v11, v10}, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->isRemoteSideClosed(I)Z

    move-result v11

    if-eqz v11, :cond_a

    .line 171
    :cond_9
    sget-object v11, Lorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;->INVALID_STREAM:Lorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;

    invoke-direct {p0, p1, p2, v10, v11}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->issueStreamError(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/MessageEvent;ILorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;)V

    goto/16 :goto_0

    .line 176
    :cond_a
    iget-object v11, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->spdySession:Lorg/jboss/netty/handler/codec/spdy/SpdySession;

    invoke-virtual {v11, v10}, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->hasReceivedReply(I)Z

    move-result v11

    if-eqz v11, :cond_b

    .line 177
    sget-object v11, Lorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;->PROTOCOL_ERROR:Lorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;

    invoke-direct {p0, p1, p2, v10, v11}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->issueStreamError(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/MessageEvent;ILorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;)V

    goto/16 :goto_0

    .line 181
    :cond_b
    iget-object v11, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->spdySession:Lorg/jboss/netty/handler/codec/spdy/SpdySession;

    invoke-virtual {v11, v10}, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->receivedReply(I)V

    .line 182
    invoke-interface {v8}, Lorg/jboss/netty/handler/codec/spdy/SpdySynReplyFrame;->isLast()Z

    move-result v11

    if-eqz v11, :cond_3

    .line 184
    invoke-direct {p0, v10, v12}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->halfCloseStream(IZ)V

    goto/16 :goto_1

    .line 187
    .end local v8           #spdySynReplyFrame:Lorg/jboss/netty/handler/codec/spdy/SpdySynReplyFrame;
    .end local v10           #streamID:I
    :cond_c
    instance-of v11, v1, Lorg/jboss/netty/handler/codec/spdy/SpdyRstStreamFrame;

    if-eqz v11, :cond_d

    move-object v6, v1

    .line 196
    check-cast v6, Lorg/jboss/netty/handler/codec/spdy/SpdyRstStreamFrame;

    .line 197
    .local v6, spdyRstStreamFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyRstStreamFrame;
    invoke-interface {v6}, Lorg/jboss/netty/handler/codec/spdy/SpdyRstStreamFrame;->getStreamID()I

    move-result v11

    invoke-direct {p0, v11}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->removeStream(I)V

    goto/16 :goto_1

    .line 199
    .end local v6           #spdyRstStreamFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyRstStreamFrame;
    :cond_d
    instance-of v11, v1, Lorg/jboss/netty/handler/codec/spdy/SpdySettingsFrame;

    if-eqz v11, :cond_e

    move-object v7, v1

    .line 205
    check-cast v7, Lorg/jboss/netty/handler/codec/spdy/SpdySettingsFrame;

    .line 206
    .local v7, spdySettingsFrame:Lorg/jboss/netty/handler/codec/spdy/SpdySettingsFrame;
    invoke-direct {p0, v7, v12}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->updateConcurrentStreams(Lorg/jboss/netty/handler/codec/spdy/SpdySettingsFrame;Z)V

    goto/16 :goto_1

    .line 208
    .end local v7           #spdySettingsFrame:Lorg/jboss/netty/handler/codec/spdy/SpdySettingsFrame;
    :cond_e
    instance-of v11, v1, Lorg/jboss/netty/handler/codec/spdy/SpdyPingFrame;

    if-eqz v11, :cond_10

    move-object v5, v1

    .line 219
    check-cast v5, Lorg/jboss/netty/handler/codec/spdy/SpdyPingFrame;

    .line 221
    .local v5, spdyPingFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyPingFrame;
    invoke-interface {v5}, Lorg/jboss/netty/handler/codec/spdy/SpdyPingFrame;->getID()I

    move-result v11

    invoke-direct {p0, v11}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->isRemoteInitiatedID(I)Z

    move-result v11

    if-eqz v11, :cond_f

    .line 222
    invoke-interface {p2}, Lorg/jboss/netty/channel/MessageEvent;->getChannel()Lorg/jboss/netty/channel/Channel;

    move-result-object v11

    invoke-static {v11}, Lorg/jboss/netty/channel/Channels;->future(Lorg/jboss/netty/channel/Channel;)Lorg/jboss/netty/channel/ChannelFuture;

    move-result-object v11

    invoke-interface {p2}, Lorg/jboss/netty/channel/MessageEvent;->getRemoteAddress()Ljava/net/SocketAddress;

    move-result-object v12

    invoke-static {p1, v11, v5, v12}, Lorg/jboss/netty/channel/Channels;->write(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/ChannelFuture;Ljava/lang/Object;Ljava/net/SocketAddress;)V

    goto/16 :goto_0

    .line 227
    :cond_f
    iget-object v11, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->pings:Ljava/util/concurrent/atomic/AtomicInteger;

    invoke-virtual {v11}, Ljava/util/concurrent/atomic/AtomicInteger;->get()I

    move-result v11

    if-eqz v11, :cond_0

    .line 230
    iget-object v11, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->pings:Ljava/util/concurrent/atomic/AtomicInteger;

    invoke-virtual {v11}, Ljava/util/concurrent/atomic/AtomicInteger;->getAndDecrement()I

    goto/16 :goto_1

    .line 232
    .end local v5           #spdyPingFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyPingFrame;
    :cond_10
    instance-of v11, v1, Lorg/jboss/netty/handler/codec/spdy/SpdyGoAwayFrame;

    if-eqz v11, :cond_11

    .line 234
    iput-boolean v12, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->receivedGoAwayFrame:Z

    goto/16 :goto_1

    .line 236
    :cond_11
    instance-of v11, v1, Lorg/jboss/netty/handler/codec/spdy/SpdyHeadersFrame;

    if-eqz v11, :cond_3

    move-object v4, v1

    .line 238
    check-cast v4, Lorg/jboss/netty/handler/codec/spdy/SpdyHeadersFrame;

    .line 239
    .local v4, spdyHeadersFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyHeadersFrame;
    invoke-interface {v4}, Lorg/jboss/netty/handler/codec/spdy/SpdyHeadersFrame;->getStreamID()I

    move-result v10

    .line 242
    .restart local v10       #streamID:I
    invoke-interface {v4}, Lorg/jboss/netty/handler/codec/spdy/SpdyHeadersFrame;->isInvalid()Z

    move-result v11

    if-eqz v11, :cond_12

    .line 243
    sget-object v11, Lorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;->PROTOCOL_ERROR:Lorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;

    invoke-direct {p0, p1, p2, v10, v11}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->issueStreamError(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/MessageEvent;ILorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;)V

    goto/16 :goto_0

    .line 247
    :cond_12
    iget-object v11, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->spdySession:Lorg/jboss/netty/handler/codec/spdy/SpdySession;

    invoke-virtual {v11, v10}, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->isRemoteSideClosed(I)Z

    move-result v11

    if-eqz v11, :cond_3

    .line 248
    sget-object v11, Lorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;->INVALID_STREAM:Lorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;

    invoke-direct {p0, p1, p2, v10, v11}, Lorg/jboss/netty/handler/codec/spdy/SpdySessionHandler;->issueStreamError(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/MessageEvent;ILorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;)V

    goto/16 :goto_0
.end method
